package com.learning.platform.dto;

import com.learning.platform.entity.ExamAnswer;

import java.math.BigDecimal;

public class ExamAnswerResponse {
    private Long id;
    private Long recordId;
    private Long questionId;
    private String userAnswer; // JSON格式的用户答案
    private String correctAnswer; // JSON格式的正确答案（仅在允许显示时返回）
    private Boolean isCorrect;
    private BigDecimal score;
    private BigDecimal manualScore;
    private String feedback;
    private QuestionBankResponse question; // 关联的题目信息
    
    // Constructors
    public ExamAnswerResponse() {}
    
    public ExamAnswerResponse(ExamAnswer examAnswer) {
        this.id = examAnswer.getId();
        this.recordId = examAnswer.getRecordId();
        this.questionId = examAnswer.getQuestionId();
        this.userAnswer = examAnswer.getUserAnswer();
        this.isCorrect = examAnswer.getIsCorrect();
        this.score = examAnswer.getScore();
        this.manualScore = examAnswer.getManualScore();
        this.feedback = examAnswer.getFeedback();
    }
    
    // Getters and Setters
    public Long getId() {
        return id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    public Long getRecordId() {
        return recordId;
    }
    
    public void setRecordId(Long recordId) {
        this.recordId = recordId;
    }
    
    public Long getQuestionId() {
        return questionId;
    }
    
    public void setQuestionId(Long questionId) {
        this.questionId = questionId;
    }
    
    public String getUserAnswer() {
        return userAnswer;
    }
    
    public void setUserAnswer(String userAnswer) {
        this.userAnswer = userAnswer;
    }
    
    public String getCorrectAnswer() {
        return correctAnswer;
    }
    
    public void setCorrectAnswer(String correctAnswer) {
        this.correctAnswer = correctAnswer;
    }
    
    public Boolean getIsCorrect() {
        return isCorrect;
    }
    
    public void setIsCorrect(Boolean isCorrect) {
        this.isCorrect = isCorrect;
    }
    
    public BigDecimal getScore() {
        return score;
    }
    
    public void setScore(BigDecimal score) {
        this.score = score;
    }
    
    public BigDecimal getManualScore() {
        return manualScore;
    }
    
    public void setManualScore(BigDecimal manualScore) {
        this.manualScore = manualScore;
    }
    
    public String getFeedback() {
        return feedback;
    }
    
    public void setFeedback(String feedback) {
        this.feedback = feedback;
    }
    
    public QuestionBankResponse getQuestion() {
        return question;
    }
    
    public void setQuestion(QuestionBankResponse question) {
        this.question = question;
    }
}
